<%@ include file = "/common/ini.jsp"%> 
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/common/_ApplicationContext_init.jsp"%> 
<%@ include file = "/common/_currUser_Infor.jsp"%> 
<%@ include file = "/common/_vr.jsp"%> 
<%@ include file = "/js/_js_for_select.jsp"%> 
<%@ include file = "/js/_of_js.jsp"%> 
<%
    String title = "查询试题";
%>
<%@ include file = "/common/detail/_OnForm.jsp"%>
<script>
    function goback()
    {
        window.location.href = "<%= request.getContextPath()%>/moduleinfor/back2LastList.jsp";
    }

    function reset()
    {
        addOption(detailForm.domainId,"","== 所有 ==");
        addOption(detailForm.difficultyId,"","== 所有 ==");
        addOption(detailForm.sourceId,"","== 所有 ==");
        <%
        TypeManager typeManager = (TypeManager)applicationContext.getBean("typeManager");	            
        // 域
        Object[] domains = typeManager.getByCode("domain").getSubTypes().toArray();
        for(int i = 0; i < domains.length; i ++)
        {
            Type domain = (Type)domains[i];
            %>addOption(detailForm.domainId,"<%= domain.getId()%>","<%= domain.getName()%>");<%
        }

        // 难度
        Object[] difficultys = typeManager.getByCode("difficulty").getSubTypes().toArray();
        for(int i = 0; i < difficultys.length; i ++)
        {
            Type difficulty = (Type)difficultys[i];
            %>addOption(detailForm.difficultyId,"<%= difficulty.getId()%>","<%= difficulty.getName()%>");<%
        }
        // 来源
        Object[] sources = typeManager.getByCode("questionSource").getSubTypes().toArray();
        for(int i = 0; i < sources.length; i ++)
        {
            Type source = (Type)sources[i];
            %>addOption(detailForm.sourceId,"<%= source.getId()%>","<%= source.getName()%>");<%
        }
        %>
    }

    function submitData()
    {
        detailForm.serviceURL.value = "exammanager.examquestion.FindExamQuestionsService";
        detailForm.submit();
    }
    function bodyLoadJS()
    {
        // 被聚焦的控件
        detailForm.domainId.focus(); 
    }
</script>
    <form name="detailForm" action="Controller.jsp" method="get">
        <tr>
            <td class="detailTD11">领域&nbsp;&nbsp;</td>
            <td class="detailTD12">
                <select id="domainId" name="domainId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">					
				</select>
            </td>
            <script type="text/javascript">
                new Form.Element.Observer('domainId', 1, 
                        function(element, value) 
                        {   
                            new Ajax.Updater('initSubjectJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/ajax/findBySuperTypeId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=subjectId&selectAll=&value='+value});
                         })
            </script>
			<td class="detailTD11">学科&nbsp;&nbsp;</td>
            <td class="detailTD12">                
                <select id="subjectId" name="subjectId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select>
                <span id="initSubjectJs"></span>
            </td>
            <script type="text/javascript">
                new Form.Element.Observer('subjectId', 1, 
                        function(element, value) 
                        { 
                            new Ajax.Updater('initCourseJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/ajax/findBySuperTypeId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=courseId&selectAll=&value='+value});
                            new Ajax.Updater('initQuestTypeJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/questType/findBySubjectId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=questTypeId&selectAll=&value='+value});
                        })
            </script>
			<td class="detailTD11">课程&nbsp;&nbsp;</td>
            <td class="detailTD12">
                <select id="courseId" name="courseId" onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select>
                <span id="initCourseJs"></span>
            </td>
            <script type="text/javascript">
                new Form.Element.Observer('courseId', 1, 
                        function(element, value) 
                        { 
                            new Ajax.Updater('initUnitJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/ajax/findBySuperTypeId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=unitId&selectAll=&value='+value});
                            new Ajax.Updater('initknowledgeTypeJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/knowledgeType/findBySubjectId4ajax.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=knowledgeTypeId&selectAll=&value='+value});
                        })
            </script>
        </tr>
        <tr >
            
			<td class="detailTD21">章&nbsp;&nbsp;</td>
            <td class="detailTD22">
                <select name="unitId" onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select>
                <span id="initUnitJs"></span>
            </td>
            <script type="text/javascript">
                new Form.Element.Observer('unitId', 1, 
                        function(element, value) 
                        { 
                            new Ajax.Updater('initSectionJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/ajax/findBySuperTypeId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=sectionId&selectAll=&value='+value})
                        })
            </script>
			<td class="detailTD21">节&nbsp;&nbsp;</td>
            <td class="detailTD22">
                <select name="sectionId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
				</select><span id="initSectionJs"></span>
            </td>
            <script type="text/javascript">
                new Form.Element.Observer('sectionId', 1, 
                        function(element, value) 
                        {          
                            new Ajax.Updater('initKnowledgePointJs', 
                                '<%= request.getContextPath()%>/moduleinfor/basedata/type/ajax/findBySuperTypeId.jsp', 
                                {asynchronous:true, evalScripts:true, parameters:'objId=knowledgePointId&selectAll=&value='+value})
                        })
            </script>
			<td  class="detailTD21">知识点&nbsp;&nbsp;</td>
            <td class="detailTD22">
                <select id="knowledgePointId" name="knowledgePointId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
				</select>
                <span id="initKnowledgePointJs"></span>
            </td>
        </tr>
        <tr >
           <td class="detailTD11">题型&nbsp;&nbsp;</td>
            <td class="detailTD12">
                <select name="questTypeId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select> <span id="initQuestTypeJs">
            </td>
            <td class="detailTD11">难度&nbsp;&nbsp;</td>
            <td class="detailTD12">
                <select name="difficultyId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select>
            </td>
            <td class="detailTD11">来源&nbsp;&nbsp;</td>
            <td class="detailTD12" colspan="3">
                <select name="sourceId"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true"></select>
            </td>
        </tr>
        <tr >
            <td class="detailTD21">作者&nbsp;&nbsp;</td>
            <td class="detailTD22">
                <input type="text" size="8" name="authorName"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
            </td>
            <td class="detailTD21">题目&nbsp;&nbsp;</td>
            <td class="detailTD22" colspan="5">
                <input type="text" size="25" name="content"  onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
            </td>
        </tr>
        <input type="hidden" name="serviceURL">
    </form>


<%@ include file = "/common/detail/_UnderFom_OnButton.jsp"%>
      <input  type="button" value="查询" afterFocused="" of="true" onclick="submitData()">
      &nbsp;&nbsp;<input  type="button" onclick="goback()" value="返回">
<%@ include file = "/common/detail/_UnderFom_underButton.jsp"%>